package com.jeebey.mybatis.query;

import org.apache.commons.lang3.StringUtils;

public class QParam {

	private String keyword;
	private Integer from;
	private Integer size;

	public String getKeyword() {
		return StringUtils.defaultIfBlank(keyword, null);
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}

	public Integer getPage() {
		return this.from / this.size + 1;
	}

	public Integer getFrom() {
		return from;
	}

	public void setOffset(Integer offset) {
		this.from = offset;
	}

	public Integer getSize() {
		return size;
	}

	public void setLimit(Integer limit) {
		this.size = limit;
	}

}
